package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the PAYMENTRECORD database table.
 * 
 */
@Entity
@NamedQuery(name="Paymentrecord.findAll", query="SELECT p FROM Paymentrecord p")
public class Paymentrecord implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="PAYMENTRECORD_PRID_GENERATOR", sequenceName="SEQ_34")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PAYMENTRECORD_PRID_GENERATOR")
	@Column(name="PR_ID")
	private long prId;

	@Column(name="PR_CAI_ID")
	private BigDecimal prCaiId;

	@Column(name="PR_CAI_NAME")
	private String prCaiName;

	@Column(name="PR_CUS_ID")
	private BigDecimal prCusId;

	@Column(name="PR_CUS_NAME")
	private String prCusName;

	@Column(name="PR_MAN")
	private String prMan;

	@Column(name="PR_MONEY")
	private BigDecimal prMoney;

	@Column(name="PR_PAY_WAY")
	private String prPayWay;

	@Column(name="PR_PERIOD")
	private BigDecimal prPeriod;

	@Column(name="PR_REMARKS")
	private String prRemarks;

	@Temporal(TemporalType.DATE)
	@Column(name="PR_TIME")
	private Date prTime;

	//bi-directional many-to-one association to PurchaseTb
	@ManyToOne
	@JoinColumn(name="PURCHASE_ID")
	private PurchaseTb purchaseTb;

	//bi-directional many-to-one association to PurchaseTb
	@OneToMany(mappedBy="paymentrecord")
	private List<PurchaseTb> purchaseTbs;

	public Paymentrecord() {
	}

	public long getPrId() {
		return this.prId;
	}

	public void setPrId(long prId) {
		this.prId = prId;
	}

	public BigDecimal getPrCaiId() {
		return this.prCaiId;
	}

	public void setPrCaiId(BigDecimal prCaiId) {
		this.prCaiId = prCaiId;
	}

	public String getPrCaiName() {
		return this.prCaiName;
	}

	public void setPrCaiName(String prCaiName) {
		this.prCaiName = prCaiName;
	}

	public BigDecimal getPrCusId() {
		return this.prCusId;
	}

	public void setPrCusId(BigDecimal prCusId) {
		this.prCusId = prCusId;
	}

	public String getPrCusName() {
		return this.prCusName;
	}

	public void setPrCusName(String prCusName) {
		this.prCusName = prCusName;
	}

	public String getPrMan() {
		return this.prMan;
	}

	public void setPrMan(String prMan) {
		this.prMan = prMan;
	}

	public BigDecimal getPrMoney() {
		return this.prMoney;
	}

	public void setPrMoney(BigDecimal prMoney) {
		this.prMoney = prMoney;
	}

	public String getPrPayWay() {
		return this.prPayWay;
	}

	public void setPrPayWay(String prPayWay) {
		this.prPayWay = prPayWay;
	}

	public BigDecimal getPrPeriod() {
		return this.prPeriod;
	}

	public void setPrPeriod(BigDecimal prPeriod) {
		this.prPeriod = prPeriod;
	}

	public String getPrRemarks() {
		return this.prRemarks;
	}

	public void setPrRemarks(String prRemarks) {
		this.prRemarks = prRemarks;
	}

	public Date getPrTime() {
		return this.prTime;
	}

	public void setPrTime(Date prTime) {
		this.prTime = prTime;
	}

	public PurchaseTb getPurchaseTb() {
		return this.purchaseTb;
	}

	public void setPurchaseTb(PurchaseTb purchaseTb) {
		this.purchaseTb = purchaseTb;
	}

	public List<PurchaseTb> getPurchaseTbs() {
		return this.purchaseTbs;
	}

	public void setPurchaseTbs(List<PurchaseTb> purchaseTbs) {
		this.purchaseTbs = purchaseTbs;
	}

	public PurchaseTb addPurchaseTb(PurchaseTb purchaseTb) {
		getPurchaseTbs().add(purchaseTb);
		purchaseTb.setPaymentrecord(this);

		return purchaseTb;
	}

	public PurchaseTb removePurchaseTb(PurchaseTb purchaseTb) {
		getPurchaseTbs().remove(purchaseTb);
		purchaseTb.setPaymentrecord(null);

		return purchaseTb;
	}

}